#include <iostream>

using namespace std;

int n1, n2, n3, n4, x;
int c1, c2, c3, c4;

int main() {
    cin >> n1 >> n2 >> n3 >> n4 >> x;
    int goods;
    for(int i=0;i<n1;i++){
        cin >> goods;
        if(goods > x) c1++;
    }
    for(int i=0;i<n2;i++){
        cin >> goods;
        if(goods > x) c2++;
    }
    for(int i=0;i<n3;i++){
        cin >> goods;
        if(goods > x) c3++;
    }
    for(int i=0;i<n4;i++){
        cin >> goods;
        if(goods > x) c4++;
    }
    cout << min(c1, min(c2, min(c3, c4))) << endl;
    return 0;
}